package com.example.GdxTest;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class ShapeActor extends Actor {
	
	private Texture texture;
	private Pixmap pixmap = new Pixmap(256, 256, Format.RGBA8888);
	private Color color=Color.BLUE;
	
	public ShapeActor(float r,float g,float b,float a)
	{
		super();
		Class cl=color.getClass();
		color=new Color(r/255, g/255, b/255, a);
		pixmap.setColor(color);
    	pixmap.fillRectangle(0, 0, 256, 256);
    	texture=new Texture(pixmap);
    	setBounds(0, 0, 256, 256);
	}
	
	@Override
	public void draw(SpriteBatch batch, float parentAlpha) {
		// TODO Auto-generated method stub
		batch.draw(texture, 0, 0);
	}
	
}
